﻿using System.Reflection;
using COC.Debug;
using UnityEngine;
using System.Collections;

public class Show_Health : MonoBehaviour {

	// Use this for initialization
	void Start () {
	//create a health bar
        getWorldPosition(this.gameObject.transform);
	}

    private void getWorldPosition(Transform target)
    {
        Vector3 pos=Camera.main.ScreenToWorldPoint(target.position);

        GameObject go=Resources.Load("Health") as GameObject;
        GameObject cloneGo =Instantiate(go) as GameObject;
       // g=NGUITools.AddChild(go);
        cloneGo.name = "test";
        cloneGo.transform.localScale = new Vector3(0.2f, 0.5f, 0.5f);
        cloneGo.transform.position = pos + new Vector3(20, 0, 150);
    }

    // Update is called once per frame
	void Update () {
	
	}

}
